package com.bwf.pojo;

import com.bwf.service.IRepay;

/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/5/12 9:29
 * @Copyright 博为峰
 */
public class CreditAccount extends Account implements IRepay {
    private double ceiling;

    public CreditAccount(String cardNo, String password, double balance) {
        super(cardNo, password, balance);
    }

    public double getCeiling() {
        return ceiling;
    }

    public void setCeiling(double ceiling) {
        this.ceiling = ceiling;
    }

    public void deposit(double money) {
        double balance = this.getBalance() + this.ceiling;
        balance -= money;
        this.setBalance(balance);
    }

    @Override
    public void loan() {
        double balance = this.getBalance();
        balance += 10000;
        this.setBalance(balance);
    }
}
